﻿using System;
using System.Collections.Generic;
using System.Text;

namespace KingOfCSharp.iHunter
{
    class FilterProviderWrapper : PluginWrapper, IFilterProvider
    {
        IFilterProvider filterProvider;

        public FilterProviderWrapper(IFilterProvider filterProvider)
            : base(filterProvider)
        {
            this.filterProvider = filterProvider;
        }



        #region IFilterProvider 成员


        public System.Windows.Forms.UserControl GetFilterConfigureEditor()
        {
            try
            {
                return filterProvider.GetFilterConfigureEditor();
            }
            catch (Exception e)
            {
                this.OnPluginError(e);
                return null;
            }
        }

        public System.Windows.Forms.UserControl[] GetNewFilterWizardPages()
        {
            try
            {
                return filterProvider.GetNewFilterWizardPages();
            }
            catch (Exception e)
            {
                this.OnPluginError(e);
                return null;
            }
        }

        #endregion

        #region IFilterProvider Members

        public IFilter CreateFilterInstance(FilterInfo info)
        {
            try
            {
                return filterProvider.CreateFilterInstance(info);
            }
            catch (Exception e)
            {
                this.OnPluginError(e);
                return null;
            }
        }

        #endregion
    }
}
